﻿using System;
using System.Web.Mvc;
using System.Net;

namespace Web.Controllers
{
    public class ErrorController : Controller
    {
		[AcceptVerbs(HttpVerbs.Get | HttpVerbs.Head)]
        public ViewResult NotFound(string path)
        {
            Response.StatusCode = (int)HttpStatusCode.NotFound;
            ViewBag.ErrorMessage = String.Format("Извините, страница {0} не найдена.", path);
            return View("CommonErrorView");
        }

        [AcceptVerbs(HttpVerbs.Get | HttpVerbs.Head)]
        public ViewResult Unknown()
        {
            Response.StatusCode = (int)HttpStatusCode.InternalServerError;
            ViewBag.ErrorMessage = "Извините, у нас тут что-то сломалось, но мы уже чиним.";
            return View("CommonErrorView");
        }

    }
}
